The present invention relates to a data coding apparatus and method, and a data decoding apparatus and method wherein an arithmetic coding system is used for a data compression process and a data expansion process (reproducing process for obtaining original data, that is, data as it is before it is compressed) for image information.
The arithmetic coding system has recently drawn attention, which system is a forecast coding system for coding image information.
The arithmetic coding system is described below with reference to FIG.11. For example, data to be coded is a series of binary bits such as "0", "0", "1", "0", "0", which are shown in a bottom of FIG. 11. FIG. 11 shows a process of data coding from left to right of FIG. 11. In this case, a least probability symbol (this is referred to as "LPS" hereinafter) is assigned to a symbol "1". The LPS should be determined to be assigned to the symbol which has the lowest probability of appearing in the data. A most probability symbol (this is referred to as "MPS" hereinafter) is then assigned to another symbol "0". The MPS should be determined to be assigned to the symbol which has the highest probability of appearing in the data.
Then, an LPS appearance probability is determined to be 0.3. Thus, the number line between 0 and 1, as shown drawn from bottom to top in FIG. 11, is divided into 0.3 and 0.7(=1-0.3) in accordance with the above mentioned LPS appearance probability "0.3". An segment A.sub.0.1 located at the top left of FIG. 11 having a length of 0.3 is the segment for the LPS "1", another segment A.sub.0.0 located at the bottom left of FIG. 11 having a length of 0.7, is a segment for the MPS "0". Then, the first data is the symbol "0" (MPS), thus the segment A.sub.0.0 is selected.
Then, the vertical length between the top and bottom of the segment A.sub.0.0 is again divided into 0.3 and 0.7, and resulting segments are A.sub.1.1 for the LPS "1" and A.sub.1.0 for the MPS "0". The second data also is the symbol "0" (MPS), thus the segment A.sub.1.0 is selected. Then, the length of the segment A.sub.1.0 is again divided into 0.3 and 0.7, and the resulting segments are A.sub.2.1 for the LPS "1" and A.sub.2.0 for the MPS "0". The third data is the symbol "1" (LPS ), thus, in this case, the segment A.sub.2.1 is selected.
As a result of repeating the data coding processes mentioned above, the length of the segment selected becomes gradually shorter as shown in FIG. 11 (The length of the hatched segment becomes shorter from left to right.). Coded data is determined to describe a position on the number line between 0 and 1, which position is finally selected by the end of the data coding process. For example, in this case, the segment A.sub.4.0 is finally selected, which segment is positioned about 0.4 on the number line. Thus, the coded data is for example determined to be "0.4".
In the data decoding process, the original data "0", "0", "1", "0", and "0" is obtained from the coded data 0.4 and the LPS appearance probability "0.3". Therefore, the above mentioned original data is compressed to become the appearance probability and the coded data.
The above-mentioned process with regard to the arithmetic coding system is executed based on a forecast value in the case where image information is coded by means of the arithmetic coding system. The forecast value is obtained as a result of the following process. An LPS appearance probability is forecast based on the pixel data of pixels surrounding a pixel, the data of which pixel is to be coded. This forecasting is executed while the pixel data of the pixels of each line, which pixel data are to be coded, are successively provided, which pixel data constitute the symbol succession. A constant initial value acting as the initial forecast value of the LPS appearance probability mentioned above is predetermined before the arithmetic coding process is started.
The number of data bits comprising the code generated as the result of the above mentioned arithmetic coding system is reduced as the forecast value of the LPS appearance probability approaches the actual appearance probability. This results in an improved coding efficiency.
The initial forecast value of the appearance probability is normally predetermined to be "0.5" because it cannot be forecast. The value "0.5" is determined under the assumption that the appearance probabilities of the most probability symbol (this is referred to as "MPS" hereinafter) and the LPS are equal to each other. The word "appearance probability" means the probability that data will describe the MPS or the LPS.
However, such appearance probabilities vary depending on the type of image to be processed. For example, the LPS (corresponding to a dark pixel in this example) appearance probability for a picture image having light and dark parts may be high such as "0.5". On the other hand, one for characters may be low such as "0.2".
For example, there may be a case where: an image resulting in a low LPS appearance probability such as a picture image is processed; and the initial forecast value of an appearance probability of the LPS is predetermined to be "0.5". In this case, the forecast value of an LPS appearance probability gradually approaches the actual appearance probability from the initial forecast value "0.5" as shown in FIG. 1, as coding proceeds.
The forecast value of the LPS appearance probability seems to vary gradually in FIG. 1, but it actually varies in steps, one step for each pixel, or one step for each plurality of pixels.
However, in this case, the coding efficiency is degraded as the result of the large number of data bits being generated during a constant period until the forecast value approaches the actual appearance probability. As a result, during that period, the process speed may be slow.
Further, such an initial forecast value is independently determined each time before the start of each page to be processed in the related art (this means the art related to the present invention hereinafter) in the case where coding is performed on images on a plurality of pages. In this case, the degrading of coding efficiency mentioned above occurs each time the coding process is performed on a page.
The above-mentioned related art has a problem in that an efficient execution of the coding and/or decoding process for image information can not be realized because the coding efficiency is degraded depending on the type of image to be processed as mentioned above.